package com.xiaozhen.quartz.feign;

import com.xiaozhen.common.core.constant.ServiceNameConstants;
import com.xiaozhen.common.core.domain.R;
import com.xiaozhen.common.core.domain.device.Device;
import com.xiaozhen.common.core.domain.driver.ParseModbusAttribute;
import com.xiaozhen.common.core.domain.driver.ParseModbusDriver;
import com.xiaozhen.common.core.domain.driver.param.ModbusParam;
import com.xiaozhen.quartz.feign.fallback.ModbusServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * HISTORY
 *
 * @author zhenweisheng
 * @date 2021/11/17 9:25
 * @description:
 */
@FeignClient(name = ServiceNameConstants.MODBUS_SERVICE,
        fallbackFactory = ModbusServiceFallback.class)
public interface ModbusService {

    /**
     * 读取设备数据
     *
     * @param modbusParam
     * @return
     */
    @PostMapping("/modbus/read")
    R<String> read(@RequestBody ModbusParam modbusParam);
}
